#ifndef _LEVEL_H_
#define _LEVEL_H_

/*
*   日志等级类
*/

namespace Log
{
    class LogLevel
    {
    public:
        //c++11 枚举关键字enum class
        //日志等级
        enum class value
        {
            UNKNOW = 0, //未知
            DEBUG,      //测试调试等级日志
            INFO,       //提示等级日志
            WARN,       //警告等级日志
            ERROR,      //错误等级日志
            FATAL,      //致命等级日志
            OFF         //关闭日志
        };
        
        //获取日志等级对应字符串形式
        static const char* toString(LogLevel::value level)
        {
            switch(level)
            {
                case LogLevel::value::DEBUG: return "DEBUG";
                case LogLevel::value::INFO: return "INFO";
                case LogLevel::value::WARN: return "WARN";
                case LogLevel::value::ERROR: return "ERROR";
                case LogLevel::value::FATAL: return "FATAL";
                case LogLevel::value::OFF: return "OFF";
            }
            return "UNKNOW";
        }
    };

}

#endif